function y=equas(mu,sigma,T,lambda,w1,w2)

g1=(lambda*w1^(1-sigma)+(1-lambda)*(w2*T)^(1-sigma))^(1/(1-sigma));
    g2=(lambda*(w1*T)^(1-sigma)+(1-lambda)*w2^(1-sigma))^(1/(1-sigma));
    y1=mu*lambda*w1+(1-mu)/2;
    y2=mu*(1-lambda)*w2+(1-mu)/2;
    InW1=(y1*g1^(sigma-1)+y2*g2^(sigma-1)*T^(1-sigma))^(1/sigma);
    InW2=(y1*g1^(sigma-1)*T^(1-sigma)+y2*g2^(sigma-1))^(1/sigma);

while w1-InW1>=0.01 || w2-InW2>=0.01
    w1=InW1;
    w2=InW2;
    g1=(lambda*w1^(1-sigma)+(1-lambda)*(w2*T)^(1-sigma))^(1/(1-sigma));
    g2=(lambda*(w1*T)^(1-sigma)+(1-lambda)*w2^(1-sigma))^(1/(1-sigma));
    y1=mu*lambda*w1+(1-mu)/2;
    y2=mu*(1-lambda)*w2+(1-mu)/2;
    InW1=(y1*g1^(sigma-1)+y2*g2^(sigma-1)*T^(1-sigma))^(1/sigma);
    InW2=(y1*g1^(sigma-1)*T^(1-sigma)+y2*g2^(sigma-1))^(1/sigma);
end

omega1=w1*g1^(-mu);
omega2=w2*g2^(-mu);
y=omega1-omega2;    

    

